-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Keyboard: automatically reload mapping file and update tooltips #13082
base: main
Are you sure you want to change the base?
Conversation
oh, need to consider skin reload... edit: Done. |
c41be0a
to
6896dc8
Compare
6896dc8
to
428caf9
Compare
Done. |
428caf9
to
7f055f3
Compare
We could add dummy shortcuts (empty) to all currently unmapped menubar actions so users can add shortcuts themselves. Nothing that holds up this PR though. |
7f055f3
to
4583b2d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not too important, but the upper/lowercasing of KeyboardEventFIlter
got a bit mixed up the commit message Keyboard: handle mapping file and config setting in KeyboardEventFIlter
`.
This one has a conflict now. Can we remove the 2.5-beta milestone? |
Sure, assigned it to 2.5 for now because I think this is a bugfix, see #9814 Set to draft because I've just rebased this and am about to tweak it considering @cr7pt0gr4ph7's suggestions. |
4583b2d
to
61db431
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small nitpick: Spelling of "chnanged" in the commit message. LGTM otherwise.
61db431
to
0b63ef6
Compare
Thanks for taking the time to review!
Yeah, that happens when I work in bright sunlight... |
…are toggled or mapping file changed
…are toggled or mapping file changed
0d83677
to
44f47e9
Compare
Oh sorry, I did a rebase instead of merging main. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
couple codestyle complaints
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is mostly copy pasted, right? Do you want to improve it or leave it?
some thoughts on the general tooltip update approach used here and performance: With the current implementatoin kbd mapppings are (re)loaded
so I think a tiny performance hit (GUI thread) in these non-critical situations is an acceptable tradeoff for having the GUI reflect the complete kbd mapping (all possible poti sub-controls) immediatly, even if it's just for double-checking that the mapping has been applied as expected. The current method is:
The downside: So I tried another approach, hoping that it would it be faster (in total, ie. load mapping file, check shortcuts, update widgets):
I had to implement the compare method and store more data in KeyboardEventFilter, and it turned out that this did not shorten the total time to the extent that it justifies the additional complexity (and potential errors/inconsistency), given that shortcuts are evaluated rarely. |
0a3d391
to
465ba9a
Compare
some thoughts on the general tooltip update approach used here and performance: With the current implementatoin kbd mapppings are (re)loaded
so I think a tiny performance hit (GUI thread) in these non-critical situations is an acceptable tradeoff for having the GUI reflect the complete kbd mapping (all possible poti sub-controls) immediatly, even if it's just for double-checking that the mapping has been applied as expected. The current method is:
The downside: So I tried another approach, hoping that it would it be faster (in total, ie. load mapping file, check shortcuts, update widgets):
I had to implement the compare method and store more data in KeyboardEventFilter, and it turned out that this did not shorten the total time to the extent that it justifies the additional complexity (and potential errors/inconsistency), given that shortcuts are evaluated rarely. |
IMO this is now ready for a final review. |
94f3037
to
e9f3ca0
Compare
e9f3ca0
to
c85011c
Compare
Yeeiij, finally!
Tooltips and the mapping are rebuilt completely if the mapping file has been changed (or removed).
As before, we look for the user's
Custom.kbd.cfg
first, then use the built-in mapping based on the selected locale.This 'only' covers the GUI mapping.Extending this to WMainMenuBar, as done in #1746, iscertainly possibly.done ✔️Inspired by #1746, but implemented more simply.
Replaces #13074
Fixes #9814